package com.sz.biz.logistics.ord.entity;

import com.sz.common.base.dao.ext.IEnum;

/**
 * Package: com.sz.biz.logistics.ord.entity<br>
 * Function: 原始物流消息的转换类型
 * Author: yanhong.xiao.<br>
 * Date: 2017-05-11 15:47:00.
 */
public enum ConvertStatus implements IEnum {

    TOBE_CONVERT("101", "待转换"),
    CONVERT_SUCCESS("102", "转换成功"),
    CONVERT_FAIL("103", "转换失败"),
    NOT_CONVERT("104", "不转换(消息重复或者其他错误消息引起)");

    private String code;
    private String name;

    ConvertStatus(String code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static ConvertStatus valueOfEnum(String code) {
        ConvertStatus[] iss = values();
        for (ConvertStatus cs : iss) {
            if (cs.getCode().equals(code)) {
                return cs;
            }
        }
        return null;
    }
}
